<template>
  <header>
    <div class="l-content">
      <el-button plain icon="el-icon-menu" size="mini"  @click="collapseMenu"></el-button>
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/page1' }">首页</el-breadcrumb-item>
  
      </el-breadcrumb>
    </div>
    <div class="r-content">
      <el-dropdown trigger="click" size="mini">
        <span class="el-dropdown-link"><img :src="userImg" class="user"/></span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item @click.native="showMessage">个人中心</el-dropdown-item>
          <el-dropdown-item  @click.native="logOut">退出</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </header>
</template>

<script>
export default {
  computed: {
 
  },
  data() {
    return {
      userImg: require('../assets/images/user.png')
    }
  },
  methods: {

        collapseMenu() {
      this.$store.commit('collapseMenu')
      console.log(this.$store.state.isCollapse)
    },

    logOut()
    {
      console.log("登出")

       this.$router.push('/') 
      
    },
    showMessage()
    {
       this.$notify({
          title: 'tips',
          message: '功能尚未开发，请联系管理员',
           offset: 100,
            type: 'success'
        });

    }

  }
}
</script>

<style lang="scss" scoped>
header {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-between;
}
.l-content {
  display: flex;
  align-items: center;
  .el-button {
    margin-right: 20px;
  }
}
.r-content {
  .user {
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }
}
</style>

<style lang="scss">
.el-breadcrumb__item {
  .el-breadcrumb__inner {
    color: #666666;
    font-weight: normal;
  }
  &:last-child {
    .el-breadcrumb__inner {
      color: #ffffff;
    }
  }
}
</style>
